Repository navigation
fix: make the layout work on mobile and small screens (#5) - #17
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
#5) Fix the stress count clipping at 5,000,000 points, wrap and trim the header and GPU panel at 1024px and 640px, turn the popup into a bottom sheet on phones, and keep the GPU panel clear of the popup at tablet width. Plan updated with the two live drive tunings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Treat short landscape screens as narrow, drop GPU panel separators for a column gap so wrapped rows never end in one, keep the bottom sheet header sticky so Close stays in view, cap the expanded layer panel above an open sheet, and tighten header spacing so it clears at 641px. Plan updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…#5) Limit the short-height narrow condition to 1024px wide so 1440x480 and 1100x450 keep the desktop layout, cap the narrow layer panel above the GPU panel, and cap the desktop popup to the map area with a sticky header at every width. Plan updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…#5) Make .app-body overflow: clip so the dialog focus cannot scroll it, and fade the bottom sheet in instead of sliding it up past the map area. Plan updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
… CSS (#5) Set build.cssTarget to older browsers so the minifier stops emitting range media syntax that Safari before 16.4 cannot parse, and move overflow: clip into @supports so the hidden fallback survives minification. Plan updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…#5) The entry bundle uses class static blocks, so browsers that cannot parse range media syntax never run the app. Restore vite.config.js and keep overflow: clip in @supports so the hidden fallback survives minification. Plan updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…#5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the app usable on phones and small windows. Before this change there were no media queries: at 375px the header text overlapped, the GPU panel ran off the left edge, and the layer panel covered more than half the map.
NARROW_QUERY=(max-width: 640px), (max-width: 1024px) and (max-height: 500px), shared bysrc/hooks/useMediaQuery.jsand the CSS):<button type="button">witharia-expanded,aria-controlspointing at the panel body, a:focus-visibleoutline, and a 218x32 target. When collapsed, the body uses thehiddenattribute, so its controls leave the Tab order and the accessibility tree. On wide screens no button is rendered and the panel works as before.|separators so a wrapped row never ends in one.max-width: calc(100vw - 32px)and wraps.max-height: calc(100% - 48px)with a sticky header, so Close stays visible while a long feature scrolls..app-bodygetsoverflow: clip(inside@supports, withhiddenas the fallback), so focusing the popup dialog can never scroll the map area..stress-slidergetsmin-width: 0, and.stress-countgetsflex-shrink: 0; min-width: 64px. "5.0M PTS" now fits at every width.Plan
docs/plans/2026-11-07-issue-5-layout-breaks-on-mobile.md, committed at 6bcb271 before any code. It was revised in later commits as review found gaps:build.cssTargetwas tried in c778581 and removed in bf9f7d8: the JS bundle already needs Vite 8's default targets (chrome111, safari16.4), and every one of those parses range media syntax.Test evidence
Gate on b584144 (the later commit only changes the plan).
npm run buildwas rerun before the verifier drives.New tests:
src/hooks/useMediaQuery.test.js: returns false without matchMedia, followschangeevents, removes its listener, checks the query string.src/components/LayerPanel.test.jsx(narrow screens): the toggle's name,aria-expandedandaria-controls; the body is hidden and its controls are out of the accessibility tree; click, Enter and Space toggle it; the toggle comes first in Tab order; no toggle on wide screens.src/components/GPUInfoPanel.test.jsx: which items carry the secondary class.Live drive: headless Chrome through Playwright on the production preview build, plus the dev server to open popups from the store, and real clicks on port points. Headless Chrome has no WebGPU, so it renders 2 layer rows and "WebGL Fallback". Final independent verifier on b584144:
.app-bodyscrollTop over 3 opens, sampled every framearia-expandedgoes false, then true. Collapsed, Tab skips the panel body. Keyboard focus shows a 2px rgb(0,255,136) outline at -2px.Review findings
Each finding was checked against the code before it was fixed or dismissed.
Fixed:
|separator ended a wrapped GPU panel row. Claude finder and Fable finder notes..app-body, and the dialog'sfocus()scrolled it. Verifier 1. The sheet now fades in, and.app-bodyusesoverflow: clip.overflow: hiddenfallback. Claude delta finder.clipnow sits inside@supports.build.cssTarget. A delta finder then showed it bought nothing, since the JS bundle's targets already parse range syntax, so it was removed.--only above 1024px, a new "Small screens" bullet, theuseMediaQueryentry in the project layout, and plan criterion references and counts.Dismissed, with reasons:
bodywhen the window crosses the breakpoint with focus inside the panel. Rare, and the plan chose not to auto-collapse.getSnapshotdoes not cache its MediaQueryList. AmatchMediacall is cheap.MediaQueryList.addEventListener. Below the build's targets..app-titlescrollWidth check cannot fail. The pairwise overlap check covers the title.Nits left as they are:
gpu-info-secondaryclass on the separators is now redundant.Process notes:
Out of scope, for issue #7: the 20x20 popup Close button, the 2px slider track, and contrast.
Docs reconciled
README.md:--only above 1024px.useMediaQueryadded to the project layout.CLAUDE.md: no change needed. Its gate, rules, and git exception are unaffected.CLAUDE.md,.claude/**, orREVIEW.mdchanges, so there are no eval-suite implications.Closes #5
🤖 Generated with Claude Code
https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf